package com.wx.chapter8;

/**
 * ClassName:HomeWork03
 * Package :com.wx.chapter8
 * Description :
 *
 * @Author : coder_mu
 * @Create : 2023/5/28 - 16:16
 */
public class HomeWork03 {
    public static void main(String[] args) {
        Professor professor = new Professor("jay", 18, "ceo", 1888, 1.3);
        System.out.println(professor.introduce());
    }
}

class Teacher {
    private String name;
    private int age;
    private String post;
    private double salary;

    public String introduce() {
        return "name=" + name + " age=" + age + " post=" + post + " salary=" + salary;
    }

    public Teacher(String name, int age, String post, double salary) {
        this.name = name;
        this.age = age;
        this.post = post;
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getPost() {
        return post;
    }

    public void setPost(String post) {
        this.post = post;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }
}

class Professor extends Teacher {
    private double grade;

    public Professor(String name, int age, String post, double salary, double grade) {
        super(name, age, post, salary);
        this.grade = grade;
    }

    @Override
    public String introduce() {
        System.out.println("教授的信息");
        return super.introduce() + " grade=" + grade;
    }
}